//FIX
var login=false;

var channel = _.extend({}, Backbone.Events),
    mediator = new Mediator({
        channel: channel
    }),
    makeMyDreamBtn = new MakeMyDream({
        el: "#makeMyDreamBtn",
        channel: channel
    }),
    makeMyDreamForm = new MakeMyDreamForm({
        el: "#makeMyDreamForm",
        channel: channel
    }),
    welcomeScreen = new WelcomeScreen({
        el: "#welcomeScreen",
        channel: channel
    }),
    findADreamStore = new FindADreamStore({
        el: "#findADreamStore",
        channel: channel
    }),
    registrationForm = new RegistrationForm({
        el: "#registrationForm",
        channel: channel
    }),
    proposeADreamForm = new ProposeADreamForm({
        el: "ProposeADreamForm",
        channel: channel
    });
$("#makeMyDreamComeTrue").click(function () {
    channel.trigger("cShowMakeMyDreamForm");
});
$("#makeADreamComeTrue").click(function () {
    channel.trigger("cShowFindADreamStore");
});
$("#findDreams").click(function () {
     channel.trigger("cShowFindADreamStore");
});
$("#home").click(function () {
     channel.trigger("cShowWelcomeScreen");
});
$("#register").click(function () {
    $("#loginForm").hide();
    $("#register").hide();

     channel.trigger("cShowRegistrationForm");
});
$("#loginBtn").click(function () {
     $("#loginForm").hide();
    $("#register").hide();
    $("#myDreams").show();
     $("#viewMyDream").show();
    $("#lMail").show();
    $("#loggedIn").html($("#lMail").val());
    $("#loggedIn").show()
    channel.trigger("cHideWelcomeScreen");
});
$("#myDreams").click(function(){
    channel.trigger("cClearAll");
     $("#viewMyDream").show();
});